# -*- coding:utf-8 -*-
"""
@Time : 2021/3/16 00:00
@Author: langengel
@Des: 系统权限
"""
from models.base import Rule
from validator.base import AddRule
from core.response.BaseResponse import success, fail


async def create_rule(post: AddRule):
    """
    添加系统权限
    :param post: AddRule
    :return:
    """

    add_rule = await Rule().create(**post.dict())

    if add_rule:
        return success(msg="添加成功")

    return fail(msg="添加失败")
